#include <iostream>
#include <queue>
#include "MarsRover.h"
#include "DDConsole.h"

using namespace std;

struct Command
{
    char type;
    double d;
};


int main(int argc, char const *argv[])
{
    Rover* marsRover = new MarsRover("x001", "Ambulance", "Scanner");
    vector<DisplayDevice*> ddVec;
    ddVec.push_back(new DDConsole());
    marsRover->setDisplayDevices(ddVec);

    queue<struct Command> q;

    struct Command cmd1;
    cmd1.type = 'm';
    cmd1.d = 1;

    struct Command cmd2;
    cmd2.type = 'm';
    cmd2.d = -5;

    struct Command cmd3;
    cmd3.type = 'r';
    cmd3.d = 30;

    q.push(cmd1);
    q.push(cmd2);
    q.push(cmd3);

    while (!q.empty())
    {
        struct Command cmd = q.front();
        q.pop();
        switch (cmd.type)
        {
        case 'm':
            marsRover->move(cmd.d);
            break;
        case 'r':
            marsRover->rotate(cmd.d);
            break;
        default:
            break;
        }
    }
    cout << "end" << endl;
    return 0;
}
